/* navigation.css */
:root {
  --nav-width: 280px;
  --nav-bg: #f8f9fa;
  --nav-border: #e9ecef;
  --nav-text: #495057;
  --nav-hover: #007AFF;
  --nav-active: #007AFF;
  
  /* iOS风格圆角 */
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  
  /* iOS风格阴影 */
  --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 6px rgba(0,0,0,0.1);
}

/* 全局字体设置 */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 导航容器 */
.prototype-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.3s ease-out;
  overflow-y: auto;
  box-shadow: var(--shadow-medium);
}

/* 导航隐藏状态 */
.prototype-nav.nav-hidden {
  transform: translateX(-100%);
}

/* 导航头部 */
.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--nav-border);
  background: white;
  box-shadow: var(--shadow-light);
}

.nav-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--nav-text);
}

.nav-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--nav-text);
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s ease;
}

.nav-toggle:hover {
  background: #f1f3f4;
}

/* 导航菜单 */
.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  border-bottom: 1px solid #f1f3f4;
}

.nav-link {
  display: block;
  padding: 16px 20px;
  color: var(--nav-text);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: #f1f3f4;
  color: var(--nav-hover);
}

.nav-link.active {
  background: rgba(0, 122, 255, 0.1);
  color: var(--nav-active);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--nav-active);
  border-radius: 0 2px 2px 0;
}

/* 主内容区域 */
.prototype-main {
  margin-left: var(--nav-width);
  transition: margin-left 0.3s ease-out;
  min-height: 100vh;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.prototype-main.nav-hidden {
  margin-left: 0;
}

/* 页面容器 */
.page-container {
  opacity: 1;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  width: 100%;
  height: 100%;
}

.page-container.loading {
  opacity: 0.5;
}

/* 导航触发按钮 */
.nav-trigger {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: var(--nav-active);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  transition: all 0.2s ease;
  opacity: 0;
  transform: translateX(-10px);
}

.nav-trigger:hover {
  transform: translateX(-10px) scale(1.05);
}

.nav-trigger.show {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* 桌面端导航隐藏时显示触发按钮 */
.prototype-main.nav-hidden ~ .nav-trigger {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* 页面切换动画 */
.page-fade-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.page-fade-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-fade-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* 加载状态的脉冲效果 */
@keyframes loading-pulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

.page-container.loading {
  animation: loading-pulse 1.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .prototype-nav {
    transform: translateX(-100%);
  }
  
  .prototype-nav.nav-open {
    transform: translateX(0);
  }
  
  /* 确保移动端时nav-hidden类不会影响导航 */
  .prototype-nav.nav-hidden {
    transform: translateX(-100%);
  }
  
  .prototype-main {
    margin-left: 0;
  }
  
  .nav-trigger {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
  }
  
  /* 导航遮罩层 */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
  }
  
  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
} 